﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="edit.aspx.cs" Inherits="JumbotCms.WebFile.Admin._javascriptedit" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<title>自定义外站调用</title>
<link type="text/css" rel="stylesheet" href="../../admin/otherpage/styles/common.css" />
<script type="text/javascript" src="../../_data/SysConfig.js"></script>
<script type="text/javascript" src="../../_libs/jquery-min.js"></script>
<script type="text/javascript" src="../../scripts/jumbotcms.js?v4"></script>
<link type="text/css" rel="stylesheet" href="../../style/global.css" />
<link type="text/css" rel="stylesheet" href="../../_libs/jquery.formvalidator/style.css" />
<script type="text/javascript" src="../../_libs/jquery.formvalidator.js"></script>

<script type="text/javascript">
$(document).ready(function(){
	$.formValidator.initConfig({onError:function(msg){}});
	$("#txtCode").formValidator({tipid:"tipCode",onshow:"只能是数字和字母",onfocus:"字母区分大小写",oncorrect:""}).RegexValidator({regexp:"^[a-zA-Z0-9]+$",onerror:"只能是数字和字母"})
		.AjaxValidator({
		type : "get",
		data:		"id=<%=id%>",
		url:		"ajax.aspx?oper=checkname&time="+(new Date().getTime()),
		datatype : "json",
		success : function(d){	
			if(d.result == "1")
				return true;
			else
				return false;
		},
		buttons: $("#btnSave"),
		error: function(){alert("服务器没有返回数据，可能服务器忙，请重试");},
		onerror : "该代码名已经存在",
		onwait : "正在校验代码名的合法性，请稍候..."
	}).DefaultPassed();
	$("#txtTitle").formValidator({tipid:"tipTitle",onshow:"",onfocus:"",oncorrect:""}).InputValidator({min:8,max:30,onerror:"请输入8-30个字符或4-15个汉字,请确认"});
	$("#txtTitleLen").formValidator({tipid:"tipTitleLen",onshow:"请填写数字,0表示继承宏标记中的参数",onfocus:"请填写数字,0表示继承宏标记中的参数",oncorrect:""}).RegexValidator({regexp:"^\([0-9]{1,3})$",onerror:"请填写数字"});
	$("#txtChannelId").formValidator({tipid:"tipChannelId",onshow:"请填写非零数字",onfocus:"请填写非零数字",oncorrect:""}).RegexValidator({regexp:"^\([1-9]{1}[0-9]*)$",onerror:"请填写非零数字"});
	$("#txtClassId").formValidator({tipid:"tipClassId",onshow:"请填写数字,0表示所有",onfocus:"请填写数字,0表示所有",oncorrect:""}).RegexValidator({regexp:"^\([0-9]+)$",onerror:"请填写数字"});
	$("#txtSelectNumber").formValidator({tipid:"tipSelectNumber",onshow:"建议填8、10、20",onfocus:"建议填8、10、20",oncorrect:""}).RegexValidator({regexp:"^\([1-9]{1}[0-9]{0,1})$",onerror:"请填写非零数字"});
});
    </script>
</head>
<body>
<form id="form1" runat="server" onsubmit="return jQuery.formValidator.PageIsValid('1')">
	<table class="formtable">
		<tr>
			<th> 名称 </th>
			<td><asp:TextBox ID="txtTitle" runat="server" MaxLength="20" Width="225px" CssClass="ipt"></asp:TextBox>
				<div class="ValidatorTip" id="tipTitle" style="width:250px"> </div></td>
		</tr>
		<tr>
			<th> 调用频道Id </th>
			<td><asp:TextBox ID="txtChannelId" runat="server" Width="50px" CssClass="ipt">0</asp:TextBox>
				<div class="ValidatorTip" id="tipChannelId" style="width:250px"> </div></td>
		</tr>
		<tr>
			<th> 调用栏目Id </th>
			<td><asp:TextBox ID="txtClassId" runat="server" Width="50px" CssClass="ipt">0</asp:TextBox>
				<div class="ValidatorTip" id="tipClassId" style="width:250px"> </div></td>
		</tr>
		<tr>
			<th> 调用记录的数量 </th>
			<td><asp:TextBox ID="txtSelectNumber" runat="server" Width="50px">10</asp:TextBox>
				<div class="ValidatorTip" id="tipSelectNumber" style="width:250px"> </div></td>
		</tr>
		<tr style="display:none;">
			<th> 代码名 </th>
			<td> <asp:TextBox ID="txtCode" runat="server" Width="97%" CssClass="ipt"></asp:TextBox>
				<div class="ValidatorTip" id="tipCode" style="width:250px"> </div></td>
		</tr>
		<tr>
			<th> 标题最大输出字符 </th>
			<td><asp:TextBox ID="txtTitleLen" runat="server" Width="50px">50</asp:TextBox>
				<div class="ValidatorTip" id="tipTitleLen" style="width:250px"> </div></td>
		</tr>
		<tr>
			<th> 更多参数参照 </th>
			<td><asp:DropDownList ID="ddlJumbotLiCode" runat="server"> </asp:DropDownList></td>
		</tr>
	</table>
	<div class="buttonok">
		<asp:Button ID="btnSave" runat="server" Text="确定" CssClass="btnsubmit" 
            onclick="btnSave_Click" />
		<input id="btnReset" type="button" value="取消" class="btncancel" OnClick="parent.JumbotCms.Popup.hide();" />
	</div>
</form>
<script>jcms$$SetDialogTitle();</script>
</body>
</html>
